package org.example.bean;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;

public class BeanA implements BeanNameAware, InitializingBean {

    private String tag;
    private String beanName;

    public BeanA() {
        System.out.println("beanA 的构造方法");
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        System.out.println("set 属性注入");
        this.tag = tag;
    }

    @Override
    public void setBeanName(String beanName) {
        System.out.println("aware 属性注入");
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("InitializingBean 接口初始化方法");
    }

    public void init(){
        System.out.println("自定义 init 初始化方法");
    }


}
